import React from 'react';
import Item, { IFormItemProps } from './Item'


import DatePicker from 'antd/lib/date-picker'
import { WeekPickerProps, RangePickerProps, MonthPickerProps, DatePickerProps } from 'antd/lib/date-picker/interface';
// import DatePickerDecorator from 'antd/lib/date-picker';

const { MonthPicker, RangePicker, WeekPicker } = DatePicker;

interface IDatePickerProps extends DatePickerProps, IFormItemProps {
	id?: string,
}

interface IRangePickerProps extends RangePickerProps, IFormItemProps {
	id?: string,
}


class FormRangePicker extends React.Component<IRangePickerProps> {
	render() {
		return (
			<Item {...this.props}
				render={() => <RangePicker {...this.props} />} />
		)
	}
}
class FormMonthPicker extends React.Component<IDatePickerProps> {
	render() {
		return (
			<Item {...this.props}
				render={() => <MonthPicker {...this.props} />} />
		)
	}
}
class FormWeekPicker extends React.Component<IDatePickerProps> {
	render() {
		return (
			<Item {...this.props}
				render={() => <WeekPicker {...this.props} />} />
		)
	}
}


export default class FormDatePicker extends React.Component<IDatePickerProps> {
	render() {
		return (
			<Item {...this.props}
				render={() => <DatePicker {...this.props} />} />
		)

	}

	public static RangePicker = FormRangePicker
	public static MonthPicker = FormMonthPicker
	public static WeekPicker = FormWeekPicker
}